package org.hackystat.ui.sensordatabrowser.client.common;

import java.io.Serializable;

/**
 * This class represents one event of sensor data elements in the UI display, an event is
 * quantized to the the sensor data types occurring within one minute that have the same 
 * type and tool attributes.
 * @author David J. Nickles
 */
public class Event implements Serializable {
  
  /** Serializable ID. */
  private static final long serialVersionUID = 3276434385259057190L;
  private String timestamp;
  private String type;
  private String tool;
  private String title;
  private int count;
  
  /**
   * @return the xmlTimestamp
   */
  public String getTimestamp() {
    return timestamp;
  }
  
  /**
   * @param timestamp the xmlTimestamp to set
   */
  public void setTimestamp(String timestamp) {
    this.timestamp = timestamp;
  }
  
  /**
   * @return the type
   */
  public String getType() {
    return type;
  }
  
  /**
   * @param type the type to set
   */
  public void setType(String type) {
    this.type = type;
  }
  /**
   * @return the tool
   */
  public String getTool() {
    return tool;
  }
  
  /**
   * @param tool the tool to set
   */
  public void setTool(String tool) {
    this.tool = tool;
  }
  
  /**
   * @return the title
   */
  public String getTitle() {
    return title;
  }
  
  /**
   * @param title the title to set
   */
  public void setTitle(String title) {
    this.title = title;
  }
  
  /**
   * @return the count
   */
  public int getCount() {
    return count;
  }
  
  /**
   * @param count the count to set
   */
  public void setCount(int count) {
    this.count = count;
  }
  
  /**
   * No parameters constructor required by GWT.
   */
  public Event() {
    super();
    this.timestamp = null;
    this.type = null;
    this.tool = null;
    this.title = null;
    this.count = 0;
  }
  
  /**
   * Parameterized constructor for creating a valid event.
   * @param timestamp the event timestamp.
   * @param type the sensor data type of this event.
   * @param tool the tool for this event.
   * @param title a title for this event.
   * @param count the number of items this event represents.
   */
  public Event(String timestamp, String type, String tool, String title, int count) {
    super();
    this.timestamp = timestamp;
    this.type = type;
    this.tool = tool;
    this.title = title;
    this.count = count;
  }
}
